package org.dlow.router;

import org.dlow.common.constants.LoadBalance;
import org.dlow.register.ServiceRegistry;
import org.dlow.spi.ExtensionLoader;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @Author: 山沐与山
 * @CreateTime: 2024-05-16 00:18
 */
public class ServiceSelectorFactory {


    public static ServiceSelector get(LoadBalance loadBalance){
        return ExtensionLoader.getInstance().get(loadBalance.name);
    }

    public static ServiceSelector get(String name){
        return ExtensionLoader.getInstance().get(name);
    }

    public static void init() throws IOException, ClassNotFoundException {
        ExtensionLoader.getInstance().loadExtension(ServiceSelector.class);
    }
}

